#!/usr/local/bin/ruby

require 'rubygems'
require 'twitter'
require 'time'
require 'cgi'

OAUTH_CONSUMER_KEY    = ''
OAUTH_CONSUMER_SECRET = ''
OAUTH_ACCESS_TOKEN    = ''
OAUTH_ACCESS_SECRET   = ''

PROXY_ADDR = nil

if /\(\+http:\/\/code\.google\.com\/appengine; appid: superhogebot\)/ =~ ENV[ 'HTTP_USER_AGENT' ] then
  oauth = Twitter::OAuth.new( OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET )
  oauth.authorize_from_access( OAUTH_ACCESS_TOKEN, OAUTH_ACCESS_SECRET )
  base = Twitter::Base.new( oauth )

  base.update Time.now
end

cgi = CGI.new
puts cgi.header
puts 'permission error.'

f = File.open( './hoge.txt', 'a' )
f.puts Time.now
ENV.each do |key, value|
  f.puts key, value
end
f.puts

